package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.GraftingclipApplyTemporaryConMapper;
import com.ruoyi.consume.domain.GraftingclipApplyTemporaryCon;
import com.ruoyi.consume.service.IGraftingclipApplyTemporaryConService;

/**
 * 嫁接夹临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class GraftingclipApplyTemporaryConServiceImpl implements IGraftingclipApplyTemporaryConService
{
    @Autowired
    private GraftingclipApplyTemporaryConMapper graftingclipApplyTemporaryConMapper;

    /**
     * 查询嫁接夹临时领用
     *
     * @param graftingclipApplyTemporaryId 嫁接夹临时领用ID
     * @return 嫁接夹临时领用
     */
    @Override
    public GraftingclipApplyTemporaryCon selectGraftingclipApplyTemporaryById(Long graftingclipApplyTemporaryId)
    {
        return graftingclipApplyTemporaryConMapper.selectGraftingclipApplyTemporaryById(graftingclipApplyTemporaryId);
    }

    /**
     * 查询嫁接夹临时领用列表
     *
     * @param graftingclipApplyTemporaryCon 嫁接夹临时领用
     * @return 嫁接夹临时领用
     */
    @Override
    public List<GraftingclipApplyTemporaryCon> selectGraftingclipApplyTemporaryList(GraftingclipApplyTemporaryCon graftingclipApplyTemporaryCon)
    {
        return graftingclipApplyTemporaryConMapper.selectGraftingclipApplyTemporaryList(graftingclipApplyTemporaryCon);
    }

    /**
     * 新增嫁接夹临时领用
     *
     * @param graftingclipApplyTemporaryCon 嫁接夹临时领用
     * @return 结果
     */
    @Override
    public int insertGraftingclipApplyTemporary(GraftingclipApplyTemporaryCon graftingclipApplyTemporaryCon)
    {
        graftingclipApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return graftingclipApplyTemporaryConMapper.insertGraftingclipApplyTemporary(graftingclipApplyTemporaryCon);
    }

    /**
     * 修改嫁接夹临时领用
     *
     * @param graftingclipApplyTemporaryCon 嫁接夹临时领用
     * @return 结果
     */
    @Override
    public int updateGraftingclipApplyTemporary(GraftingclipApplyTemporaryCon graftingclipApplyTemporaryCon)
    {
        graftingclipApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return graftingclipApplyTemporaryConMapper.updateGraftingclipApplyTemporary(graftingclipApplyTemporaryCon);
    }

    /**
     * 批量删除嫁接夹临时领用
     *
     * @param graftingclipApplyTemporaryIds 需要删除的嫁接夹临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipApplyTemporaryByIds(Long[] graftingclipApplyTemporaryIds)
    {
        return graftingclipApplyTemporaryConMapper.deleteGraftingclipApplyTemporaryByIds(graftingclipApplyTemporaryIds);
    }

    /**
     * 删除嫁接夹临时领用信息
     *
     * @param graftingclipApplyTemporaryId 嫁接夹临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipApplyTemporaryById(Long graftingclipApplyTemporaryId)
    {
        return graftingclipApplyTemporaryConMapper.deleteGraftingclipApplyTemporaryById(graftingclipApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param graftingclipApplyTemporaryCon 嫁接夹临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(GraftingclipApplyTemporaryCon graftingclipApplyTemporaryCon){
        return graftingclipApplyTemporaryConMapper.updateAmount(graftingclipApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param graftingclipApplyTemporaryId 嫁接夹临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long graftingclipApplyTemporaryId){
        return graftingclipApplyTemporaryConMapper.updateConsumeStatus(graftingclipApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param graftingclipApplyTemporaryId 嫁接夹临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long graftingclipApplyTemporaryId){
        return graftingclipApplyTemporaryConMapper.updateApprovalStatus(graftingclipApplyTemporaryId);
    }
}
